import 'package:flutter_framework/utils/http/model/result_model.dart';

import 'home_data_item.dart';

class HomeListRes extends ResultModel {
  HomeListRes(super.data, super.code, super.msg, super.isSuccess);
}

class HomeListData {
  int? page;
  int? totalPage;
  List<HomeDataItem>? list;
  int? totalCount;

  HomeListData({this.page, this.totalPage, this.list, this.totalCount});

  HomeListData.fromJson(Map<String, dynamic> json) {
    page = json['page'];
    totalPage = json['totalPage'];
    if (json['list'] != null) {
      list = <HomeDataItem>[];
      json['list'].forEach((v) {
        list!.add(HomeDataItem.fromJson(v));
      });
    }
    totalCount = json['totalCount'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['page'] = this.page;
    data['totalPage'] = this.totalPage;
    if (this.list != null) {
      data['list'] = this.list!.map((v) => v.toJson()).toList();
    }
    data['totalCount'] = this.totalCount;
    return data;
  }
}
